-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]Type errors in embading function #1169 #1517
[BUG]Type errors in embading function #1169 #1517
Conversation
…b.com/DevMadhav13/chroma into type_errors_in_embading_function_1169
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! Please fix all the small indentation changes and then we're good to check this in.
model_name: str = "all-MiniLM-L6-v2", | ||
device: str = "cpu", | ||
normalize_embeddings: bool = False, | ||
self, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please unindent these -- we don't want them double-indented.
api_version: Optional[str] = None, | ||
deployment_id: Optional[str] = None, | ||
default_headers: Optional[Mapping[str, str]] = None, | ||
self, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please unindent these as well
@@ -220,7 +222,7 @@ class HuggingFaceEmbeddingFunction(EmbeddingFunction[Documents]): | |||
""" | |||
|
|||
def __init__( | |||
self, api_key: str, model_name: str = "sentence-transformers/all-MiniLM-L6-v2" | |||
self, api_key: str, model_name: str = "sentence-transformers/all-MiniLM-L6-v2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here and everywhere below. I'll stop leaving comments about this :^)
@beggers Double-indents are removed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two more small nits and then we can check this in.
Sorry to be annoying -- I just want to keep the code as clean as possible. Thank you again for doing this!
|
||
# Return just the embeddings | ||
return [result["embedding"] for result in sorted_embeddings] | ||
embading = [result["embedding"] for result in sorted_embeddings] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: embedding, not embading
@@ -36,7 +36,7 @@ class SentenceTransformerEmbeddingFunction(EmbeddingFunction[Documents]): | |||
models: Dict[str, Any] = {} | |||
|
|||
# If you have a beefier machine, try "gtr-t5-large". | |||
# for a full list of options: https://huggingface.co/sentence-transformers, https://www.sbert.net/docs/pretrained_models.html | |||
# for a full list of options: https://huggingface.co/sentence-transformers, https://www.sbert.net/docs/pretrained_models.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we added an extra space here, can we remove?
@beggers no Problem , corrections are done in new commit "Spell correction" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small things. We're almost there!
hey @DevMadhav13 if we can get my suggested minor changes into this PR then I'll merge it! Thank you for taking this work on -- makes our codebase more readable and easier to work in. |
Co-authored-by: Ran <rccalman@gmail.com>
Co-authored-by: Ben Eggers <64657842+beggers@users.noreply.github.com>
Co-authored-by: Ben Eggers <64657842+beggers@users.noreply.github.com>
@beggers Added suggested Commits which is missed to check. |
Description of changes
Test plan
How are these changes tested?
pytest
for python,yarn test
for jsDocumentation Changes
Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs repository?